build: Collect gi-docgen's common arguments
authorEmmanuele Bassi <ebassi@gnome.org>
Mon, 1 Nov 2021 13:00:51 +0000 (13:00 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Mon, 1 Nov 2021 13:00:51 +0000 (13:00 +0000)
And only enable `--fatal-warnings` if `-Dwerror` has been set, just like
we do for the introspection data generation.

docs/reference/gdk/meson.build
docs/reference/gsk/meson.build
docs/reference/gtk/meson.build
docs/reference/meson.build

index 57da47f5f1c876a056111550351cdbdb4d1cd63d..9a38c618d61426327e0f9a418ad643f104cdc001 100644 (file)
@@ -16,12 +16,10 @@ if get_option('gtk_doc')
     command: [
       gidocgen,
       'generate',
-      '--quiet',
-      '--fatal-warnings',
+      gidocgen_common_args,
       '--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
       '--config=@INPUT0@',
       '--output-dir=@OUTPUT@',
-      '--no-namespace-dir',
       '--content-dir=@0@'.format(meson.current_source_dir()),
       '@INPUT1@',
     ],
@@ -46,12 +44,10 @@ if get_option('gtk_doc')
       command: [
         gidocgen,
         'generate',
-        '--quiet',
-        '--fatal-warnings',
+        gidocgen_common_args,
         '--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
         '--config=@INPUT0@',
         '--output-dir=@OUTPUT@',
-        '--no-namespace-dir',
         '--content-dir=@0@'.format(meson.current_source_dir()),
         '@INPUT1@',
       ],
@@ -78,12 +74,10 @@ if get_option('gtk_doc')
       command: [
         gidocgen,
         'generate',
-        '--quiet',
-        '--fatal-warnings',
+        gidocgen_common_args,
         '--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
         '--config=@INPUT0@',
         '--output-dir=@OUTPUT@',
-        '--no-namespace-dir',
         '--content-dir=@0@'.format(meson.current_source_dir()),
         '@INPUT1@',
       ],
index 13f636091dd4bee7cd2685f158bb560c6dbc4845..abb30381e69d647acca6f18866e6c72cacdbd71e 100644 (file)
@@ -13,12 +13,10 @@ if get_option('gtk_doc')
     command: [
       gidocgen,
       'generate',
-      '--quiet',
-      '--fatal-warnings',
+      gidocgen_common_args,
       '--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
       '--config=@INPUT0@',
       '--output-dir=@OUTPUT@',
-      '--no-namespace-dir',
       '--content-dir=@0@'.format(meson.current_source_dir()),
       '@INPUT1@',
     ],
index 7ae01f045110c50b473a99d3f1fe97137b3da288..441207c2b270dff3297d0eff4a7ebb2426c29b8a 100644 (file)
@@ -42,12 +42,10 @@ if get_option('gtk_doc')
     command: [
       gidocgen,
       'generate',
-      '--quiet',
-      '--fatal-warnings',
+      gidocgen_common_args,
       '--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
       '--config=@INPUT0@',
       '--output-dir=@OUTPUT@',
-      '--no-namespace-dir',
       '--content-dir=@0@'.format(meson.current_source_dir()),
       '@INPUT1@',
     ],
index 4ca44b67e8a9f35331501331e3014e6f6decf341..df5e3d9909008c9b68956920e3c99afb5a323eec 100644 (file)
@@ -3,6 +3,15 @@ toml_conf.set('version', meson.project_version())
 
 gidocgen = find_program('gi-docgen', required: get_option('gtk_doc'))
 
+gidocgen_common_args = [
+  '--quiet',
+  '--no-namespace-dir',
+]
+
+if get_option('werror')
+  gidocgen_common_args += ['--fatal-warnings']
+endif
+
 docs_dir = gtk_datadir / 'doc'
 
 if get_option('gtk_doc') and not build_gir